package org.example.controller;

import org.example.method.test;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class testController {
  @PostMapping("/async/test")
  public ResponseEntity<String> testAsync() {
    try {
      test.main(null);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    return ResponseEntity.ok("ok");
  }

  @PostMapping("/test")
  public ResponseEntity<String> test() {
    try {
      test.main(new String[] {"boolean"});
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    return ResponseEntity.ok("ok");
  }
}
